﻿<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="News.aspx.cs" Inherits="Weixin.Web.News" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
    <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1.0, user-scalable=no" />
    <title>中国税务咨询师</title>
    <link rel="stylesheet" href="Styles/jquery.mobile-1.3.2.min.css" />
    <script type="text/javascript" src="Scripts/jquery-1.9.1.min.js"></script>
    <script type="text/javascript" src="Scripts/jquery.mobile-1.3.2.min.js"></script>
    <link rel="stylesheet" href="Styles/css.css" />
    <script type="text/javascript">
        $(function () {
            GetData();
        })

        function GetData() {
            var para = "typeId=" + $("#typeId").val() + "&page=" + $("#nowPage").val() + "&d=" + new Date().toString();
            $.ajax({
                type: "get",
                url: "News.aspx",
                data: para,
                success: function (msg) {
                    //alert(msg);
                    var obj = eval('(' + msg + ")");
                    if (obj.pageCount > 0) {
                        $("#pageCount").val(obj.pageCount);
                        $.each(obj.items, function (idx, itm) {
                            //alert(itm.id + "," + itm.title);
                            var str = "<li " + ((parseInt($("#nowPage").val()) == 1 && idx == 0) ? "class=\"first\"" : "") + ">";
                            str += "<span class=\"jiantou1\">></span>";
                            str += "<a href=\"News_txt.aspx?typeId=" + itm.typeId + "&id=" + itm.id + "\" style=\"color:#000\" data-ajax=\"false\">" + itm.title + "</a>";
                            str += "</li>";
                            $("#mylist").append(str);
                            if (parseInt($("#nowPage").val()) == parseInt(obj.pageCount)) {
                                $("#more").hide();
                            }
                        })
                    }
                },
                error: function () {

                }
            })
        }

        function LoadMore() {
            $("#nowPage").val(parseInt($("#nowPage").val()) + 1);
            GetData();
        }
    </script>
</head>
<body>
    <form id="form1" runat="server">
    <div data-role="page">
        <div class="content" data-role="content">
            <div>
                <span class="hotline">咨询热线:400-677-1077</span><img src="images/logo.jpg" />
            </div>
            <div class="sep"></div>
            <h3 runat="server" id="hTitle">
                </h3>
            <div class="nav"><a href="###">中国税务咨询师</a></div>
            <ul class="list1" id="mylist">
            </ul>
            <a href="javascript:void(0);" data-role="button" data-corners="false" onclick="LoadMore();" id="more">加载更多...</a>
        </div>
    </div>
    <input type="hidden" id="nowPage" value="1" />
    <input type="hidden" id="pageCount" value="0" />
    <input type="hidden" id="typeId" value="0" runat="server" />
    </form>
</body>
</html>
